package gui.data.D2;

import gui.MyFrame;

import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.TextField;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;

public class CircleOutputGui extends JPanel {

	JLabel radiusLbl, diameterLbl, circumferenceLbl, areaLbl, arcLbl,
			arcAreaLbl, arcAngleLbl;
	JTextField radiusInput, diameterInput, circumferenceInput, areaInput,
			arcInput, arcAreaInput, arcAngleInput;

	public CircleOutputGui(double radius, double diameter,
			double circumference, double area, double arc, double arcArea,
			double arcAngle) {

		this.setLayout(new GridLayout(8, 2));
		this.setPreferredSize(new Dimension(500, 500));

		radiusLbl = new JLabel("Radius = ");
		diameterLbl = new JLabel("Diameter = ");
		circumferenceLbl = new JLabel("Circumference = ");
		areaLbl = new JLabel("Area = ");
		arcLbl = new JLabel("Sector arc length = ");
		arcAreaLbl = new JLabel("Sector area = ");
		arcAngleLbl = new JLabel("Sector angle (degrees) = ");

		radiusInput = new JTextField(radius == 0 ? "N/A" : "" + radius);
		diameterInput = new JTextField(diameter == 0 ? "N/A" : "" + diameter);
		circumferenceInput = new JTextField(circumference == 0 ? "N/A" : ""
				+ circumference);
		areaInput = new JTextField(area == 0 ? "N/A" : "" + area);
		arcInput = new JTextField(arc == 0 ? "N/A" : "" + arc);
		arcAreaInput = new JTextField(arcArea == 0 ? "N/A" : "" + arcArea);
		arcAngleInput = new JTextField(arcAngle == 0 ? "N/A" : "" + arcAngle);

		radiusInput.setEditable(false);
		diameterInput.setEditable(false);
		circumferenceInput.setEditable(false);
		areaInput.setEditable(false);
		arcInput.setEditable(false);
		arcAreaInput.setEditable(false);
		arcAngleInput.setEditable(false);

		this.add(radiusLbl);
		this.add(radiusInput);
		this.add(diameterLbl);
		this.add(diameterInput);
		this.add(circumferenceLbl);
		this.add(circumferenceInput);
		this.add(areaLbl);
		this.add(areaInput);
		this.add(arcLbl);
		this.add(arcInput);
		this.add(arcAreaLbl);
		this.add(arcAreaInput);
		this.add(arcAngleLbl);
		this.add(arcAngleInput);
	}
}
